# This is a config file for Fraunhofer parallel file system clients.
# http://www.fhgfs.com


# --- [Table of Contents] ---
#
# 1) Settings
# 2) Mount Options
# 3) Settings Documentation


#
# --- Section 1: [Settings] --- 
#

logLevel                      = 3
logClientID                   = false
logHelperdIP                  =

connPortShift                 = 0
connMgmtdPortUDP              = 8008
connMgmtdPortTCP              = 8008
connClientPortUDP             = 8004
connHelperdPortTCP            = 8006
connUseSDP                    = false
connUseRDMA                   = true
connRDMABufSize               = 8192
connRDMABufNum                = 128
connMaxInternodeNum           = 12
connInterfacesFile            =
connNetFilterFile             = <%= @netfilter %>
connNonPrimaryExpiration      = 10000
connCommRetrySecs             = 600

tuneNumWorkers                = 0
tunePreferredMetaFile         =
tunePreferredStorageFile      =
tuneFileCacheType             = buffered
tuneRemoteFSync               = true
tuneUseGlobalFileLocks        = false

sysMgmtdHost                  = <%= @mgmtd_host %>
sysCreateHardlinksAsSymlinks  = true
sysMountSanityCheckMS         = 0


#
# --- Section 2: [Mount Options] ---
#

# Valid mount options are:
# cfgFile, logLevel, connPortShift, connMgmtdPortUDP, connMgmtdPortTCP,
# sysMgmtdHost, sysMountSanityCheckMS.
#
# Use the mount option "cfgFile" to specify a different config file
# for fhgfs_client.
# Example:
# $ /bin/mount -t fhgfs fhgfs_dev /fhgfs -ocfgFile=/etc/anotherconfig.conf
#
# Mount options override the corresponding config file values.
# Example:
# $ /bin/mount -ocfgFile=/etc/anotherconfig.conf,logLevel=3 ...


#
# --- Section 3.1: [Logging] ---
#

# [logLevel]
# Defines the amount of log messages. The higher this level, the more detailed
# the log messages will be.
# Level 3 will print connection messages, level 4 will print syscall messages,
# level 5 will print debug messages.
# Note: Levels above 3 might decrease performance.
# Default: 3 (Max: 5)

# [logClientID]
# Defines whether the ClientID should appear in each log line. This usually
# makes sense only if you use remote logging and want to use the same
# fhgfs_helperd instance for multiple clients.
# Note: Use "logHelperdIP" to enable remote logging. 
# Default: false 

# [logHelperdIP]
# Defines the IP address of the node on which the fhgfs_helperd runs for
# remote logging. This is typically useful only if you want to combine the
# log messages of several clients on a single machine.
# If this value is undefined, the fhgfs_helperd is assumed to be running on
# the local machine.
# Default: <none>


#
# --- Section 3.2: [Connections & Communication] ---
#

# [connPortShift]
# Shifts all following UDP and TCP ports according to the specified value.
# Intended to make port configuration easier in case you do not want to
# configure each port individually.  
# Default: 0

# [connMgmtdPortUDP], [connMgmtdPortTCP]
# The UDP and TCP ports of the management node.
# Default: 8008

# [connClientPortUDP]
# The UDP port of the client.
# Default: 8004

# [connHelperdPortTCP]
# The TCP port of the client helper daemon.
# Default: 8006

# [connUseSDP]
# Enables the Sockets Direct Protocol (SDP) for RDMA-ready interconnects.
# Warning: SDP has known stability issues.
# Note: SDP performance is somewhere between TCP over IB and native RDMA, so
#    there is no need to enable SDP when you have native RDMA enabled.
# Default: false

# [connUseRDMA]
# Enables the use of Remote Direct Memory Access (RDMA) for Infiniband.
# For this setting to be effective, OFED ibverbs support has to be enabled at
# compile time of the fhgfs_client modules.
# Default: true

# [connRDMABufSize], [connRDMABufNum]
# Infiniband RDMA buffer settings.
# connRDMABufSize is the maximum size of a buffer (in bytes) that will be sent
# over the network; connRDMABufNum is the number of available buffers that can
# be in flight for a single connection. These client settings are also applied
# on the server side for each connection.
# Note: RAM usage per connection is connRDMABufSize x connRDMABufNum x 2. Keep
#    resulting RAM usage (x connMaxInternodeNum x number_of_clients) on the
#    server in mind when increasing these values.
# Note: The client needs to allocate physically contiguous pages for
# connRDMABufSize, so this setting shouldn't be higher than a few kbytes.
# Default: 8192, 128

# [connMaxInternodeNum]
# The maximum number of simultaneous connections to the same node.
# Default: 6

# [connInterfacesFile]
# The path to a text file that specifies the names of the interfaces, which
# may be used for communication by other nodes. One interface per line. The
# line number also defines the priority of an interface.
# Example: "ib0" in the first line, "eth0" in the second line.
# Values: This setting is optional. If unspecified, all available interfaces
#    will be published and priorities will be assigned automatically.
# Note: This has no influence on outgoing connections. The information is sent
#    to other hosts to inform them about possible communication paths.
# Default: <none>

# [connNetFilterFile]
# The path to a text file that specifies allowed IP subnets, which may be used
# for outgoing communication. One subnet per line in classless notation (IP
# address and number of significant bits).
# Example: "192.168.10.0/24" in the first line, "192.168.20.0/24" in the second
# line.
# This value is optional. If unspecified, all addresses are allowed for
# outgoing communication.
# Default: <none>

# [connNonPrimaryExpiration]
# The number of requests after which a connection over a non-primary network
# inferface expires. When a non-primary connection expires, the system will try
# to establish a connection over the primary interface (falling back to another
# interface again if necessary).
# Note: Set this value to 0 to disable expiration.
# Note: The priority of node interfaces can be configured using the
#    "connInterfacesFile" parameter. 
# Default: 10000

# [connCommRetrySecs]
# The time (in seconds) for retries in case a network communication fails
# (e.g. if a server is down). After this time, the I/O operation will fail
# and the calling process will receive an error.
# Note: Set this value to 0 for infinite retries. In this case, a process
#    accessing the file system will block until the corresponding server
#    becomes available (or until it is interrupted by a signal).
# Default: 5



#
# --- Section 3.3: [Tuning] ---
#

# [tuneNumWorkers]
# The number of worker threads. Should be at least 3. The number of CPU cores
# of your machine (if more than three) is the recommended choice.
# Note: 0 means use number of CPU cores (but at least 3).
# Default: 0

# [tunePreferredMetaFile], [tunePreferredStorageFile]
# The path to a text file that specifies the IDs of the preferred storage
# targets and metadata servers. These will be preferred when the client creates
# new file system entries. This is useful to take advantage of data locality in
# the case of multiple data centers. If unspecified, all available servers will
# be used.
# Usage: One targetID per line for storage servers, one nodeID (hostname) per
# line for metadata servers.
# Note: TargetIDs and nodeIDs can be queried with the fhgfs-ctl tool.
# Default: <none>

# [tuneFileCacheType]
# Sets the file cache type.
# Values: "none" (disable client caching), "buffered" (use a pool of small
#    static buffers for write-back and read-ahead), "paged" (use the kernel
#    pagecache, experimental/dangerous).
# Note: The cache protocols are currently non-coherent.
# Note: When client and servers are running on the same machine, "paged"
#    contains the typical potential for memory allocation deadlocks (also
#    known from local NFS server mounts) => so do not use "paged" with
#    clients that run on a metadata or storage server machine.
# Default: buffered

# [tuneRemoteFSync]
# Controls whether fsync() syscalls from a user application should only be
# executed on the client to transfer data from the client cache to server 
# cache (=false); or also on the servers to flush the server's cached file
# data to the disks (=true).
# Default: true

# [tuneUseGlobalFileLocks]
# Controls whether application file locks should be checked for conflicts on
# the local machine only (=false) or globally on the servers (=true).
# Default: false


#
# --- Section 3.4: [System Settings] ---
#

# [sysMgmtdHost]
# Hostname (or IP) of the host running the management service.
# (See also "connMgmtdPortUDP" and "connMgmtdPortTCP")
# Default: <none>

# [sysCreateHardlinksAsSymlinks]
# Create a symlink when an application tries to create a hardlink.
# Default: true

# [sysMountSanityCheckMS]
# Perform some basic checks during mount (e.g. whether the client helper daemon
# and storage servers are reachable). Mounting will fail if a problem is
# detected.
# Values: Set the time (in ms) you want to spend waiting for the servers
# (especially the management daemon) to respond. Use 0 to disable all checks 
# and allow mounting even if no servers are reachable.
# Default: 3000
